package cn.bxshey.resourceSharing.mapper;

import cn.bxshey.resourceSharing.dto.essay.EssayDto;
import cn.bxshey.resourceSharing.entity.Essay;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * (Essay)表数据库访问层
 *
 * @author makejava
 * @since 2023-12-16 17:54:45
 */
@Mapper
public interface EssayMapper extends BaseMapper<Essay> {

    //分页查询文章
    List<Essay> paginatedQueries(@Param("current")Integer current,@Param("size") Integer size,@Param("essay") EssayDto essay);

    //查询·前7热点文章
    List<Essay> getHotArticle(@Param("kind") String[] kind);

    //统计多少条信息
    Long count(@Param("essay") EssayDto essayDto);

    //根据文章标题查询多少条
    Long searchCount(String title);

    //分页查询文章
    List<Essay> search(@Param("current")Integer current,@Param("size") Integer size,@Param("title") String title);

}

